package com.ict.config;

import java.util.Timer;
import java.util.TimerTask;

import org.apache.log4j.Logger;

import com.ict.dataprocess.FuseMQToRedis;
import com.ict.utils.MQTopicConsume;

public class FuseMainClass {
	private static Logger logger = Logger.getLogger(FuseMainClass.class);

	public static void main(String[] args) {
		String[] rountingKey = { Config.fuseTargetRoutingKey };
		MQTopicConsume mqTopicConsume = new MQTopicConsume(Config.recvMQIP, Config.recvMQPort, Config.recvMQUserName,
				Config.recvMQPasswd, "xgs", rountingKey, "xgs_tap_fuse_by_tlc");
		mqTopicConsume.ConsumeFuse();;
		TimerTask task = new TimerTask() {
			@Override
			public void run() {
				System.out.println(" orig   main  Run");
				FuseMQToRedis mqToRedis = new FuseMQToRedis();
				mqToRedis.run();
				// ExecutorService executor = Executors.newSingleThreadExecutor();

			}
		};
		Timer timer = new Timer();
		long delay = 0;
		long intevalPeriod = 1 * Config.timeCycle;
		timer.scheduleAtFixedRate(task, delay, intevalPeriod);
	}

}
